package com.ruoyi.omp.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.omp.api.domain.FeLeaseRecord;
import com.ruoyi.omp.api.domain.vo.RoomVO;
import com.ruoyi.omp.api.factory.RemoteLeaseRecordFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: cjie
 * @description: 租赁记录服务
 * @date: 2021/8/16
 */
@FeignClient(contextId = "remoteLeaseRecordService", value = ServiceNameConstants.OMP_LIFE_SERVICE, fallbackFactory =
        RemoteLeaseRecordFactory.class)
public interface RemoteLeaseRecordService {

    /**
     * 新增租赁记录
     * @param leaseRecord 租赁记录
     * @return
     */
    @PostMapping(value = "/feLeaseRecord/add")
    R addLeaseRecord(@RequestBody FeLeaseRecord leaseRecord);

    @PostMapping(value = "/feLeaseRecord/delByEnterpriseId/{enterpriseId}")
    R delRecordByEnterpriseId(@PathVariable("enterpriseId") String enterpriseId);




    /**
     * 修改租赁记录
     * @param leaseRecord 租赁记录
     * @return
     */
    @PostMapping(value = "/feLeaseRecord/update")
    R updateLeaseRecord(@RequestBody FeLeaseRecord leaseRecord);

    /**
     * 查询租赁记录列表
     * @param feLeaseRecord 租赁记录
     * @return
     */
    @PostMapping(value = "/feLeaseRecord/listRecord")
    R<List<FeLeaseRecord>> listRecord(@RequestBody FeLeaseRecord feLeaseRecord);

    /**
     * 通过企业id查询租赁记录列表
     * @param enterpriseId 租赁记录
     * @return
     */
    @GetMapping(value = "/feLeaseRecord/getLeaseRecordByEnterprise")
    R<FeLeaseRecord> getLeaseRecordByEnterprise(@RequestParam("enterpriseId") String enterpriseId);




    @GetMapping(value = "/feLeaseRecord/getRecordListByEnterpriseId")
    R<List<FeLeaseRecord>> getRecordListByEnterpriseId(@RequestParam("enterpriseId") String enterpriseId);


    /**
     * 通过租赁记录查询对应房屋信息
     * @param recordId 租赁记录id
     * @return
     */
    @GetMapping(value = "/feLeaseRecord/roomList/{recordId}")
    R<List<RoomVO>> selectRoomByRecordId(@PathVariable("recordId") String recordId);


}
